package com.tonglin.red.util;

import lombok.Data;

@Data
public class BaseResponse <T>{
    private Integer code; //状态码
    private String msg;//描述信息
    private T data; //响应数据，采用泛型表示可以接收通用的数据类型
    public BaseResponse(Integer code,String msg){
        this.code = code ;
        this.msg = msg;
    }

    public BaseResponse(StatusCode statusCode){
        this.code = statusCode.getCode();
        this.msg = statusCode.getMsg();
    }
    public BaseResponse(Integer code,String msg,T data){
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
}
